<!--
 * @Author: ITDLCL
 * @Date: 2024-10-30 14:17:27
 * @LastEditors: ITDLCL
 * @Description:
-->
<!-- 会员码 -->
<template>
  <view class="user-code">
    <!--二维码-->
    <image class="user-code_img" :src="info.memberCodeUrl" mode="widthFix"></image>
    <view class="refresh-time">刷新时间：{{info.memberCodeUpdateTime}}</view>
    <view class="refresh-btn d-flex" @click="emit('refresh')">
      <image
        src="https://bac-miniprogram.oss-cn-beijing.aliyuncs.com/images/icon/refresh_icon.png"
        mode="widthFix"
      ></image>
      <text>刷新会员码</text>
    </view>
    <view class="tip grey-text">
      本会员码一码多用
      <br />
      活动核销，会议室，自习室
    </view>
  </view>
</template>

<script setup>
let props = defineProps({
  info: {
    type: Object,
    default: {
      memberCode: "",
    },
  },
});
let emit = defineEmits(['refresh'])
</script>

<style lang="scss" scoped>
.user-code {
  margin-top: 132rpx;
  text-align: center;
  &_img {
    width: 304rpx;
    height: 304rpx;
    margin-bottom: 34rpx;
    background-color: #cccccc;
  }
  .refresh-time {
    font-size: 20rpx;
  }
  .refresh-btn {
    padding: 14rpx 0 32rpx;
    align-items: center;
    justify-content: center;
    font-size: 26rpx;
    image {
      width: 20rpx;
      margin-right: 18rpx;
    }
  }
  .grey-text {
    font-size: 20rpx;
    line-height: 24rpx;
  }
}
</style>
